global root "C:\Users\hanwa\Desktop\replication"

use "$root\data\IMC_HA_Monthly_Panel_clean.dta", replace

***Panel A: Processing speed, new claims
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_newclaim_speed imc , cohort(startdate) time(yearmonth) never_treat(no_treat) unit_fe(code) clust_unit(code) 
outreg2 using "$root\tables\table3", excel symbol(***,**,*) se replace
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_newclaim_speed imc , cohort(startdate) time(yearmonth) never_treat(no_treat) unit_fe(code) clust_unit(code) covariates (deficit_rate grant_dependence lnpop lnclaim lnwage)
outreg2 using "$root\tables\table3", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_newclaim_speed imc , cohort(startdate) time(yearmonth) never_treat(no_treat) unit_fe(code) clust_unit(code) covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table3", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_newclaim_speed imc , cohort(startdate) time(region_ym) never_treat(no_treat) unit_fe(code) clust_unit(code) covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table3", excel symbol(***,**,*) se append
restore

***Panel B: Processing speed, change of circumstances
preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_coc_speed imc , cohort(startdate) time(yearmonth) never_treat(no_treat) unit_fe(code) clust_unit(code) 
outreg2 using "$root\tables\table3", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_coc_speed imc , cohort(startdate) time(yearmonth) never_treat(no_treat) unit_fe(code) clust_unit(code) covariates (deficit_rate grant_dependence lnpop lnclaim lnwage)
outreg2 using "$root\tables\table3", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_coc_speed imc , cohort(startdate) time(yearmonth) never_treat(no_treat) unit_fe(code) clust_unit(code) covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table3", excel symbol(***,**,*) se append
restore

preserve
drop if startdate==-1
keep if cem_matched==1
stackedev hb_coc_speed imc , cohort(startdate) time(region_ym) never_treat(no_treat) unit_fe(code) clust_unit(code) covariates (deficit_rate grant_dependence lnpop lnclaim lnwage  kids private umemploy pension vulnerable )
outreg2 using "$root\tables\table3", excel symbol(***,**,*) se append
restore
